<div ng-controller="shopMenuCtrl">
	<!-- <div class="row text-center">
    	<a class="mousehand" data-toggle="modal" data-target="#addType"><img ng-src="assets/images/addType.png"></a>
    	<a class="mousehand" data-toggle="modal" data-target="#addType"><img ng-src="assets/images/addMenu.png"></a>
    </div> -->
    <!-- Tab分类 -->
    <div class="row">
    	<ul class="menu-filter-list list-inline margin-b-40 text-center">
	        <li ui-sref-active="active" class="is-checked" data-filter="" ng-click="showType('')">全部</li>
	        <!-- <li ui-sref-active="active" ng-repeat="x in food_types" data-filter=".{{x.type}}" ng-click="showType(x.type)">{{x.name}}</li> -->
	        <li ui-sref-active="active" ng-repeat="x in food_types" data-filter=".{{x.type}}" ng-click="showType(x.name)">{{x.name}}</li>
	        <!-- 增加修改食物类型或菜品 -->
			<li ui-sref-active="active" class="dropdown clarity">
                <a class="dropdown-toggle js-activated" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><img ng-src="assets/images/addType.png"></a>
                <ul class="dropdown-menu" >
                	<!-- 更新类型 -->
                    <li><a class="mousehand" data-toggle="modal" data-target="#addType" ng-click="editMenuType()">编辑类型</a></li>
                    <!-- 新增菜品 -->
                    <li><a class="mousehand" data-toggle="modal" data-target="#addMenu">新增菜品</a></li>
                </ul>
            </li>
	        <!-- 更新类型详细列表 -->
        	<div class="modal fade" id="addType" tabindex="-1" role="dialog" aria-labelledby="myMenuLabel" aria-hidden="true">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h3 class="modal-title" id="myFormLabel">编辑菜单类型</h3>
                        </div>
                        <div class="modal-body">
                            <div class="row">
                            	<div class="row myTag">
                            		<a ng-repeat="x in food_type_data">
                            			{{x.name}}<span class="glyphicon glyphicon-remove" ng-click="deleteMenuType($index)"></span>
                            		</a>
                            	</div>
                            	<div class="col-sm-8 col-sm-offset-2 text-left member-body">
                                    <div class="row">
                                        <!-- <label>姓名</label> -->
                                        <div class="input-group ">
                                        	<input type="text" class="form-control" placeholder="请输入类型" ng-model="new_menuType"/>
                                            <div class="input-group-addon">
                                            	<span class="glyphicon glyphicon-tags"></span>
                                            </div>
                                        </div>   
                                    </div>
                                    <div class="row">
                                        <input type="submit" value="添加" class="btn btn-primary btn-lg" ng-click="addMenuType()" style="width: 50%;">
                                    </div>
                                </div>
                            </div>
                      </div>
                  </div>
                </div>
          	</div>
          	<!-- 新增菜品详细列表 -->
	        <div class="modal fade" id="addMenu" tabindex="-1" role="dialog" aria-labelledby="myMenuLabel">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h3 class="modal-title" id="myFormLabel">新增菜品</h3>
                        </div>
                        <div class="modal-body">
                            <div class="row">
							    <form ref='uploadForm' id='uploadForm' action='/api/addDishes' method='post' encType="multipart/form-data">
                                    <div class="editMenu">
	                                    <div class="shipping-calculator-fields">
	                                    	<div class="row">
					                            <div class="col-sm-6">
					                                <div class="form-group">
					                                    <label>商品名称</label>
					                                    <input type="text" class="form-control" placeholder="请输入商品名称" name="name"
					                                    ng-model="new_menuData.name">
					                                </div><!--/form-group-->
					                            </div>
					                            <div class="col-sm-6">
					                                <div class="form-group">
					                                    <label>商品价格</label>
					                                    <input type="text" class="form-control" placeholder="请输入商品价格" name="price" ng-model="new_menuData.price">
					                                </div><!--/form-group-->
					                            </div>
					                        </div>
					                        <div class="row">
					                            <div class="col-sm-6">
					                                <div class="form-group">
					                                    <label>商品类型</label>
					                                    <select class="form-control" ng-change="addfoodType(x)" ng-model="x" name="type">
					                                    	<option value="" disabled selected hidden>请选择类型</option>
					                                        <option ng-repeat="x in food_types">{{x.name}}</option>
					                                    </select>
					                                </div><!--/form-group-->
					                            </div>
					                            <div class="col-sm-6">
					                                <div class="form-group">
					                                    <label>图片上传</label>
					                                    <div class="input-group">
										                    <input type="text" class="form-control" name="r_time" id="r_time" placeholder="请上传菜品美照" ng-model="add_img" style="margin-bottom: 0px;">
										                    <span class="input-group-addon">
										                        <!-- <input id='hiddenFilePhotos' accept="image/bmp, image/png, image/tiff, image/gif, image/jpeg" type="file" nv-file-select="" uploader="uploaderImage" ng-show="" ng-click="checkImg()"/> -->
										                        <input type="file" name="addMenuImage" id='addMenuImg' accept="image/bmp, image/png, image/tiff, image/gif, image/jpeg" ng-show=""/>
										                        <div onclick="javascript: $('#addMenuImg').click();" class="mousehand">
										                            <span class="glyphicon glyphicon-open"></span>
										                            <a style="color: black;">点击上传</a>
										                        </div>
										                    </span>
										                </div>

					                                </div><!--/form-group-->
					                            </div>
					                        </div>
					            			<!-- <div class="row">
					                            <div class="col-sm-12">
					                                <div class="form-group">
					                                    <label>图片上传：</label>
					                                    <a ng-bind="edit_menuData.img"></a>
					                                    <input type="file" nv-file-select uploader="uploaderImage" ng-show="" style="display: inline;" id='hiddenFileImage'/>
					                                    <a type="button" class="btn btn-xs btn-primary" onclick="javascript: $('#hiddenFileImage').click();">选择文件</a>

					                                    <strong ng-bind="edit_img"></strong>
    													<a ng-click="uploaderImage.funcRemoveItem()" ng-show='check_show'><span class="glyphicon glyphicon-remove"></span></a>
					                                </div>
												</div>
					                        </div> -->

					                        <div class="row">
					                            <div class="col-sm-12">
					                                <div class="form-group">
					                                    <label>商品描述</label>
					                                    <input type="text" class="form-control" placeholder="请输入商品相关描述" name ="food_detail" ng-model="new_menuData.detail">
					                                </div><!--/form-group-->
					                            </div>
					                        </div>
					                         
					                        <!-- <input type="submit" value="保存" class="btn btn-primary btn-lg" ng-click="addNewMenu()" style="margin-bottom:0px;"> -->
					                        <input type="submit" value="保存" class="btn btn-primary btn-lg" style="margin-bottom:0px;">
	                                    </div>
	                                </div>
							    </form>
                            </div>
                      </div>
                  </div>
                </div>
          	</div>
	    </ul>
    </div>
    <!-- Tab分类 -->
    

    <!-- 详细列表 -->
    <div class="row">
    	<div class="menu-filter-items">
	        <div ui-sref-active="active" ng-repeat="y in food_menu | filter:{type: filterType} | paging:currentPage*listsPerPage | limitTo:listsPerPage" class=" start breakfast col-lg-4 col-md-4 col-sm-6 margin-b-30 menu-item ">
	        <!-- <div ui-sref-active="active" ng-repeat="y in food_menu | filter:{type: filterType}" class=" start breakfast col-lg-3 col-md-4 col-sm-6 margin-b-30 menu-item "> -->
	        	<div class="border-shadow">
		        	<a class="menu-grid">
		                <img src="{{y.img}}" alt="" class="img-responsive">
		                <div class="menu-grid-desc">                               
		                    <span class="price pull-right">￥{{y.price}}</span>
		                    <h4>{{y.name}}</h4>
		                    <hr>
		                    <div class="row">
		                    	<div class="col-sm-6 text-center">
		                    		<a class="btn btn-dark btn-xg" style="width: 70%" data-toggle="modal" data-target="#myMenu" ng-click="editMenu($index)">编辑</a>
		                    		<!-- 编辑菜单 -->
				                    <div class="modal fade" id="myMenu" tabindex="-1" role="dialog" aria-labelledby="myMenuLabel">
		                                <div class="modal-dialog" role="document">
		                                    <div class="modal-content">
		                                        <div class="modal-header">
		                                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		                                            <h3 class="modal-title" id="myFormLabel">编辑菜单</h3>
		                                        </div>
		                                        <div class="modal-body">
			                                        <div class="row">
													    <form ref='uploadForm' id='uploadForm' action='/api/editMenu' method='post' encType="multipart/form-data">
				                                            <div class="editMenu">
							                                    <div class="shipping-calculator-fields">
							                                    	<div class="row">
											                            <div class="col-sm-6">
											                                <div class="form-group">
											                                    <label>商品名称</label>
											                                    <input type="text" class="form-control" placeholder="请输入商品名称" name="name"
											                                    ng-model="edit_menuData.name">
											                                </div><!--/form-group-->
											                            </div>
											                            <div class="col-sm-6">
											                                <div class="form-group">
											                                    <label>商品价格</label>
											                                    <input type="text" class="form-control" placeholder="请输入商品价格" name="price" ng-model="edit_menuData.price">
											                                </div><!--/form-group-->
											                            </div>
											                        </div>
											                        <div class="row">
											                            <div class="col-sm-6">
											                                <div class="form-group">
											                                    <label>商品类型</label>
											                                    <select class="form-control" ng-change="addfoodType(x)" ng-model="x">
											                                    	<option value="" disabled selected style="display: none;">{{edit_menuData.type}}</option>
											                                        <option ng-repeat="x in food_types">{{x.name}}</option>
											                                        <!-- <option>+新增类型</option> -->
											                                    </select>
											                                    <input type="text" class="form-control" name ="type" ng-model="x" ng-show="false">
											                                </div><!--/form-group-->
											                            </div>
											                            <!-- <div class="col-sm-6">
											                                <div class="form-group">
											                                    <label>类型名称</label>
											                                    <input type="text" class="form-control" placeholder="请输入新增类型" disabled="disabled" id="addtype" name="type_name" ng-model="$parent.new_menuType">
											                                </div>
											                            </div> -->
											                            <div class="col-sm-6">
											                                <div class="form-group">
											                                	<label>图片上传</label>
											                                    <div class="input-group">
																                    <input type="text" class="form-control" id="r_time" placeholder="请上传店铺LOGO" ng-model="edit_img" style="margin-bottom: 0px;">
																                    <span class="input-group-addon">
																                        <!-- <input id='hiddenFilePhotos' accept="image/bmp, image/png, image/tiff, image/gif, image/jpeg" type="file" nv-file-select="" uploader="uploaderImage" ng-show="" ng-click="checkImg()"/> -->
																                        <input type="file" name="editMenuImage" id='editMenuImg' accept="image/bmp, image/png, image/tiff, image/gif, image/jpeg" ng-show="" />
																                        <div onclick="javascript: $('#editMenuImg').click();" class="mousehand">
																                            <span class="glyphicon glyphicon-open"></span>
																                            <a style="color: black;">点击上传</a>
																                        </div>
																                    </span>
																                </div>
											                                </div><!--/form-group-->
											                            </div>
											                        </div>

																	<!-- <div class="row">
											                            <div class="col-sm-12">
											                                <div class="form-group">
											                                    <label>图片上传</label>
											                                      <input type="file" name="menuImage" />
											                                </div>
											                            </div>
											                        </div> -->

											            			<!-- <div class="row">
											                            <div class="col-sm-12">
											                                <div class="form-group">
											                                    <label>图片上传：</label>
											                                    <a ng-bind="edit_menuData.img"></a>
											                                    <input type="file" nv-file-select uploader="uploaderImage" ng-show="" style="display: inline;" id='hiddenFileImage'/>
											                                    <a type="button" class="btn btn-xs btn-primary" onclick="javascript: $('#hiddenFileImage').click();">选择文件</a>

											                                    <strong ng-bind="edit_img"></strong>
	                        													<a ng-click="uploaderImage.funcRemoveItem()" ng-show='check_show'><span class="glyphicon glyphicon-remove"></span></a>
											                                </div>
																		</div>
											                        </div> -->

											                        <div class="row">
											                            <div class="col-sm-12">
											                                <div class="form-group">
											                                    <label>商品描述</label>
											                                    <input type="text" class="form-control" placeholder="请输入商品相关描述" name ="food_detail" ng-model="edit_menuData.detail">
											                                </div><!--/form-group-->
											                            </div>
											                        </div>

											                        <input type="text" class="form-control" name ="id" ng-model="edit_menuData.id" ng-show="false">

											                        <input type="submit" value="保存" class="btn btn-primary btn-lg" ng-click="saveEditmenu(edit_menuData)" style="margin-bottom:0px;">
							                                    </div>
							                                </div>
													    </form>
			                                        </div>
		                                        </div>
		                                  </div>
		                              </div>
		                          	</div>
		                    	</div>	
		                    	<div class="col-sm-6 text-center">
		                    		<a type="button" class="btn btn-primary btn-xg" style="width: 70%" ng-click="deleteMenu($index)">删除</a>
		                    	</div>
		                    </div>
		                    
		                </div>                           
		            </a>	
	        	</div>
	        </div>
	        <!-- <div class="container-fluid gallery no-padd">
	            <div class="row no-margin">
	                <div class="col-sm-6 col-md-3 no-padd">
	                    <a class="gallery-box" href="assets/images/img-1.jpg" data-lightbox="gallery">
	                        <img src="assets/images/img-1.jpg" alt="" class="img-responsive">
	                         <div class="gallery-overlay">
	                        <span class="ion-ios-plus-empty"></span>
	                    </div>
	                    </a>                   
	                </div>
	            </div>
	        </div> -->
	    </div>
    </div>
    <!-- 详细列表 -->

    <!-- 分页 -->
   	<div class="row">
	   	<nav aria-label="Page navigation" class="text-right">
		    <ul class="pagination mousehand">
		        <li>
		            <a aria-label="Previous" ng-click="prevPage()">
		                <span aria-hidden="true">«</span>
		            </a>
		        </li>
		        <li><a ui-sref-active="active" ng-class="{true:'currentStep',false:'step'}[num==currentPage]" ng-repeat="num in pageNum" ng-click="setPage(num)">{{num+1}}</a></li>
		        <li>
		            <a aria-label="Next" ng-click="nextPage()">
		                <span aria-hidden="true" >»</span>
		            </a>
		        </li>
		    </ul>
		</nav>
   	</div>
    <!-- 分页 -->


    <!-- 分页方法2 -->
    <!-- <div class="row">
	    <pagination boundary-links="true" total-items="totalItems"
	                ng-model="currentPage" class="pagination-sm embed-responsive-item"
	                previous-text="上一页"
	                next-text="下一页"
	                first-text="首页"
	                last-text="尾页"
	                max-size="maxSize"
	                rotate="false" num-pages="numPages">
	 
	 
	    </pagination>
	</div> -->

	


</div>